home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibclean / os.h < prev    next >
C/C++ Source or Header  |  1992-11-22  |  31KB  |  1,222 lines

  1. /* -*-C-*- os.h */
  2. /*-->os*/
  3. /**********************************************************************/
  4. /********************************* os *********************************/
  5. /**********************************************************************/
  6.  
  7. /* $Id: os.h,v 1.1 1992/11/07 23:24:26 beebe Exp beebe $
  8.  * $Log: os.h,v $
  9.  *
  10.  * Revision 1.15  1992/10/11  01:51:52  beebe
  11.  * Correct error in VOID_ARG definition in non Standard C environment.
  12.  *
  13.  * Revision 1.14  1992/10/10  13:50:23  beebe
  14.  * Add fileno() definition for Turbo C 3.0 or later.
  15.  *
  16.  * Revision 1.13  1992/10/09  23:58:02  beebe
  17.  * Add definitions of stdprn and stdaux for Turbo C 3.0 or later.
  18.  *
  19.  * Revision 1.12  1992/10/08  14:45:19  beebe
  20.  * Update for NeXT.  Use only __NeXT__ preprocessor symbol.
  21.  *
  22.  * Revision 1.11  1992/10/08  01:42:01  beebe
  23.  * Update for C++.
  24.  *
  25.  * Revision 1.10  1992/07/10  16:58:29  beebe
  26.  * Remove support for Lattice C.
  27.  * Add more HAVE_xxx preprocessor settings.
  28.  * Check for __unix as well as unix in preprocessor conditionals.
  29.  * Add Convex support.
  30.  *
  31.  * Revision 1.9  1992/03/11  20:47:50  beebe
  32.  * Change incorrect | to || in preprocessor statements.
  33.  *
  34.  * Revision 1.8  1992/03/10  00:32:22  beebe
  35.  * *** empty log message ***
  36.  *
  37.  * Revision 1.7  1992/03/06  14:58:06  beebe
  38.  * Complete two-month long development of version 3.0.114.  See
  39.  * 00revhst.txt for details.
  40.  *
  41.  * Revision 1.6  1992/03/01  01:28:38  beebe
  42.  * *** empty log message ***
  43.  *
  44.  * Revision 1.5  1992/02/29  19:42:20  beebe
  45.  * Update for version 3.0.114 [29-Feb-1992] following two-month
  46.  * major overhaul and compilation testing on numerous machines.
  47.  *
  48.  * Revision 1.4  1992/01/22  02:31:19  beebe
  49.  * Add RCSID() and RCS comment log.
  50.  *
  51.  * Revision 1.3  1992/01/22  02:04:26  beebe
  52.  * Add Revision Control System keyword comments.
  53.  *
  54.  */
  55.  
  56. #ifndef OS_H_DEFINED_ /* file ignored if included more than once */
  57. #define OS_H_DEFINED_
  58.  
  59. /***********************************************************************
  60. This file sets the operating system and compiler flags, automatically
  61. where this is possible based on pre-defined symbols, and also always
  62. includes stdio.h (this has been found essential to resolve problems of
  63. where to find open file limits).
  64.  
  65.     =================        =========
  66.     Operating Systems        Compilers
  67.     =================        =========
  68.     OS_ATARI            (Mark Williams)
  69.     OS_PCDOS            __TURBOC__ and (Microsoft C)
  70.     OS_PRIMOS            Prime
  71.     OS_RMX                Intel
  72.     OS_TOPS20            KCC_20 and PCC_20
  73.     OS_UNIX                (cc and GNU gcc)
  74.     OS_UNIX and OS_VAXVMS        __GNUC__
  75.     OS_VAXVMS            (VMS cc and GNU gcc)
  76.     OS_VMCMS            (Waterloo)
  77.     any                __STDC__ (Standard C conformant)
  78.     =================        =========
  79.  
  80. The operating system macros will be given definitions (0 or 1), so
  81. they can freely by used in later preprocessor expressions.  Specific
  82. compiler symbols should be used only inside code bracketed by #if
  83. OS_xxx ...  #endif.
  84.  
  85. For convenience, the following values are also set:
  86.  
  87.     STDC        0 in pre-Standard C, 1 in Standard C
  88.  
  89.     UNIX_ATT    UNIX variants
  90.     UNIX_BSD
  91.  
  92.     ARGS        argument prototypes (Standard C or pre-Standard C)
  93.     const        type modifier (new with Standard C)
  94.     errno        UNIX style error code
  95.     MAXPATHLEN    length of the longest host filename.
  96.     NULL        null pointer constant
  97.     OPENMAX        maximum number of open files per process
  98.     fpos_t        type used for file positions
  99.     offsetof    macro to return offset of element in structure
  100.     ptrdiff_t    type used for pointer differences
  101.     R_OPEN        fopen() mode flags for text read
  102.     RB_OPEN        fopen() mode flags for binary read
  103.     RW_OPEN        fopen() mode flags for text read/write
  104.     size_t        integer type returned by sizeof()
  105.     time_t        integer type used for time counters
  106.     W_OPEN        fopen() mode flags for text write
  107.     WB_OPEN        fopen() mode flags for binary write
  108.     VOIDP        void* (new with Standard C) or char* (pre-Standard C)
  109.     volatile    type modifier (new with Standard C)
  110.  
  111. Some of these are defined in Standard stddef.h; a private version of that
  112. is included below, so it need not appear in user programs.
  113.  
  114. It does not appear possible for OS_PRIMOS, OS_RMX, and OS_VMCMS to
  115. recognize the operating system automatically from predefined symbols;
  116. for those, you will have to set the OS_xxx value explicitly below, or
  117. else define it at compile time.
  118.  
  119. [07-Jul-1990]
  120. ***********************************************************************/
  121.  
  122. /***********************************************************************
  123. Standard C conformant systems must define __STDC__ to a non-zero value.
  124. All predefined macros in Standard C systems have leading and trailing
  125. double underscores, and Standard C reserves names of that form for the
  126. compiler/library implementors.    Alas, prior practice has been to
  127. predefine arbitrary names, usually in lower case, without underscores
  128. (thereby making them likely to be confused with program variables).
  129. We use some of these in tests below.  It is better to define our own
  130. names (all in upper case) and make them more systematic and less
  131. likely to clash with predefined symbols.
  132.  
  133. Alas, some compilers (Microsoft C 5.1, QuickC 2.0) predefine __STDC__
  134. to a zero value that cannot be changed, and others (GNU gcc) define it
  135. to a non-zero value when the library and system header files are not
  136. yet conformant.     Therefore, we only test if __STDC__ is defined or
  137. not, and we use a private symbol, STDC, for deciding whether we have
  138. a Standard (or almost Standard) C environment.     We use this to choose the
  139. form of function prototypes, and to decide whether certain #include
  140. header files and predefined types are available.
  141. ***********************************************************************/
  142.  
  143. /* Here are the operating systems supported. */
  144.  
  145. #ifndef OS_ATARI
  146. #define OS_ATARI        0
  147. #endif /* OS_ATARI */
  148.  
  149. #ifndef OS_PCDOS
  150. #define OS_PCDOS        0
  151. #endif /* OS_PCDOS */
  152.  
  153. #ifndef OS_PRIMOS
  154. #define OS_PRIMOS        0
  155. #endif /* OS_PRIMOS */
  156.  
  157. #ifndef OS_RMX
  158. #define OS_RMX            0
  159. #endif /* OS_RMX */
  160.  
  161. #ifndef OS_TOPS20
  162. #define OS_TOPS20        0
  163. #endif /* OS_TOPS20 */
  164.  
  165. #ifndef OS_UNIX
  166. #define OS_UNIX            0
  167. #endif /* OS_UNIX */
  168.  
  169. #ifndef OS_VAXVMS
  170. #define OS_VAXVMS        0
  171. #endif /* OS_VAXVMS */
  172.  
  173. #ifndef OS_VMCMS
  174. #define OS_VMCMS        0
  175. #endif /* OS_VMCMS */
  176.  
  177. /* Provide defaults for compiler symbols */
  178.  
  179. #ifndef IBM_PC_MICROSOFT
  180. #define IBM_PC_MICROSOFT    0
  181. #endif /* IBM_PC_MICROSOFT */
  182.  
  183. #ifndef IBM_PC_TURBO
  184. #define IBM_PC_TURBO        0
  185. #endif /* IBM_PC_TURBO */
  186.  
  187. #ifndef KCC_20
  188. #define KCC_20            0
  189. #endif /* KCC_20 */
  190.  
  191. #ifndef PCC_20
  192. #define PCC_20            0
  193. #endif /* PCC_20 */
  194.  
  195. #ifndef UNIX_ATT
  196. #define UNIX_ATT        0
  197. #endif /* UNIX_ATT */
  198.  
  199. #ifndef UNIX_BSD
  200. #define UNIX_BSD        0
  201. #endif /* UNIX_BSD */
  202.  
  203. #ifdef c_plusplus
  204. #ifndef __cplusplus
  205. #define __cplusplus        1    /* we only use this new name */
  206. #endif /* __cplusplus */
  207. #endif /* c_plusplus */
  208.  
  209. /***********************************************************************
  210. We start by assuming that most implementations will have certain basic
  211. types.  These can be overridden at compile time, or in O/S-specific
  212. sections below.  If they are not defined, then Standard-C conformant
  213. typedefs are supplied.
  214. ***********************************************************************/
  215.  
  216. #ifndef HAVE_CLOCK_T
  217. #define HAVE_CLOCK_T        1
  218. #endif /* HAVE_CLOCK_T */
  219.  
  220. #ifndef HAVE_FPOS_T
  221. #define HAVE_FPOS_T        1
  222. #endif /* HAVE_FPOS_T */
  223.  
  224. #ifndef HAVE_PROTOTYPES
  225. #define HAVE_PROTOTYPES        0
  226. #endif /* HAVE_PROTOTYPES */
  227.  
  228. #ifndef HAVE_SIZE_T
  229. #define HAVE_SIZE_T        1
  230. #endif /* HAVE_SIZE_T */
  231.  
  232. #ifndef HAVE_TIME_T
  233. #define HAVE_TIME_T        1
  234. #endif /* HAVE_TIME_T */
  235.  
  236. #ifndef HAVE_VOIDP
  237. #define HAVE_VOIDP        0
  238. #endif /* HAVE_VOIDP */
  239.  
  240. #ifndef HAVE_VOLATILE_TYPE
  241. #define HAVE_VOLATILE_TYPE    0
  242. #endif /* HAVE_VOLATILE_TYPE */
  243.  
  244. /***********************************************************************
  245. Define symbols that tell what system include files are available.  These
  246. can all be overridden at compile time.
  247. ***********************************************************************/
  248.  
  249. #ifndef HAVE_ERRNO_H
  250. #define HAVE_ERRNO_H        1
  251. #endif /* HAVE_ERRNO_H */
  252.  
  253. #ifndef HAVE_FILE_H
  254. #define HAVE_FILE_H        1
  255. #endif /* HAVE_FILE_H */
  256.  
  257. #ifndef HAVE_LIMITS_H
  258. #define HAVE_LIMITS_H        1
  259. #endif /* HAVE_LIMITS_H */
  260.  
  261. #ifndef HAVE_MATH_H
  262. #define HAVE_MATH_H        1
  263. #endif /* HAVE_MATH_H */
  264.  
  265. #ifndef HAVE_PARAM_H
  266. #define HAVE_PARAM_H        1
  267. #endif /* HAVE_PARAM_H */
  268.  
  269. #ifndef HAVE_PWD_H
  270. #define HAVE_PWD_H        0
  271. #endif /* HAVE_PWD_H */
  272.  
  273. #ifndef HAVE_STAT_H
  274. #define HAVE_STAT_H        1
  275. #endif /* HAVE_STAT_H */
  276.  
  277. #ifndef HAVE_SYS_DIR
  278. #define HAVE_SYS_DIR        1
  279. #endif /* HAVE_SYS_DIR */
  280.  
  281. #ifndef HAVE_TYPES_H
  282. #define HAVE_TYPES_H        1
  283. #endif /* HAVE_TYPES_H */
  284.  
  285. /***********************************************************************
  286. A few getxxx() library functions are often not declared in system
  287. header files.  Start by assuming they are properly declared.
  288. ***********************************************************************/
  289.  
  290. #ifndef HAVE_GETWD
  291. #define HAVE_GETWD        0    /* avoid: not a Posix function */
  292. #endif /* HAVE_GETWD */
  293.  
  294. #ifndef HAVE_GETWD_DCL
  295. #define HAVE_GETWD_DCL        0
  296. #endif /* HAVE_GETWD_DCL */
  297.  
  298. #ifndef HAVE_GETCWD
  299. #define HAVE_GETCWD        1
  300. #endif /* HAVE_GETCWD */
  301.  
  302. #ifndef HAVE_GETCWD_DCL
  303. #define HAVE_GETCWD_DCL        1
  304. #endif /* HAVE_GETCWD_DCL */
  305.  
  306.  
  307. #ifndef HAVE_GETHOSTNAME
  308. #define HAVE_GETHOSTNAME    1    /* most systems have it, but */
  309. #endif /* HAVE_GETHOSTNAME */
  310.  
  311. #ifndef HAVE_GETHOSTNAME_DCL
  312. #define HAVE_GETHOSTNAME_DCL    0    /* lack a function prototype */
  313. #endif /* HAVE_GETHOSTNAME_DCL */
  314.  
  315.  
  316. #ifndef HAVE_GETLOGIN
  317. #define HAVE_GETLOGIN        1
  318. #endif /* HAVE_GETLOGIN */
  319.  
  320. #ifndef HAVE_GETLOGIN_DCL
  321. #define HAVE_GETLOGIN_DCL    1
  322. #endif /* HAVE_GETLOGIN_DCL */
  323.  
  324.  
  325. #ifndef HAVE_GETPWNAM
  326. #define HAVE_GETPWNAM        1
  327. #endif /* HAVE_GETPWNAM */
  328.  
  329. #ifndef HAVE_GETPWNAM_DCL
  330. #define HAVE_GETPWNAM_DCL    1
  331. #endif /* HAVE_GETPWNAM_DCL */
  332.  
  333.  
  334. #ifndef HAVE_GETPWUID
  335. #define HAVE_GETPWUID        1
  336. #endif /* HAVE_GETPWUID */
  337.  
  338. #ifndef HAVE_GETPWUID_DCL
  339. #define HAVE_GETPWUID_DCL    1
  340. #endif /* HAVE_GETPWUID_DCL */
  341.  
  342.  
  343. #ifndef HAVE_GETUID
  344. #define HAVE_GETUID        1
  345. #endif /* HAVE_GETUID */
  346.  
  347. #ifndef HAVE_GETUID_DCL
  348. #define HAVE_GETUID_DCL        1
  349. #endif /* HAVE_GETUID_DCL */
  350.  
  351.  
  352. /***********************************************************************
  353. Now check for the definition of certain predefined symbols to see if
  354. we can automatically set the operating system and UNIX variant flags.
  355. This is possible for OS_PCDOS, OS_TOPS20 (KCC_20 only), OS_VAXVMS, and
  356. OS_UNIX, but not for OS_TOPS20 (PCC_20) or OS_ATARI.
  357.  
  358. On IBM VM/CMS, IBM C and Waterloo C have only 'ANSI' predefined if you
  359. compile under that option, so there is no apparently no way to detect
  360. that environment automatically.     I have no information yet on what the
  361. SAS/Lattice C compiler does.  Compile-time definition of OS_VMCMS will
  362. therefore be necessary.
  363. ***********************************************************************/
  364.  
  365. #if    VMS
  366. /***********************************************************************
  367. The VAX VMS compiler complains about undefined macros when the
  368. /STANDARD=PORTABLE compiler switch is used.  To avoid masking other
  369. legitimate problems, we define ALL referenced preprocessor symbols here.
  370. ***********************************************************************/
  371.  
  372. #define AIX            0
  373. #define BSD            0
  374. #define HAVE_CLOCK_T        1
  375. #define HAVE_CONST_TYPE        0
  376. #define HAVE_ERRNO_H        0
  377. #define HAVE_FPOS_T        1
  378. #define HAVE_GETCWD        1
  379. #define HAVE_GETCWD_DCL        1
  380. #define HAVE_GETHOSTNAME    0
  381. #define HAVE_GETHOSTNAME_DCL    0
  382. #define HAVE_GETWD        0
  383. #define HAVE_GETWD_DCL        0
  384. #define HAVE_LIMITS_H        1
  385. #define HAVE_MATH_H        1
  386. #define HAVE_MEMXXX_DCL        1    /* string.h has memxxx() declarations */
  387. #define HAVE_PARAM_H        0
  388. #define HAVE_PROTOTYPES        0
  389. #define HAVE_PWD_H        0
  390. #define HAVE_SIZE_T        0
  391. #define HAVE_STDDEF_H        0
  392. #define HAVE_STDLIB_H        0
  393. #define HAVE_STRFTIME        0
  394. #define HAVE_STRFTIME_DCL    0
  395. #define HAVE_SYS_DIR        0
  396. #define HAVE_TIME_T        0
  397. #define HAVE_TM_ZONE        0
  398. #define HAVE_TZNAME        0
  399. #define HAVE_TZNAME_DCL        0
  400. #define HAVE_VOIDP        0
  401. #define HAVE_VOLATILE_TYPE    0
  402. #define IBM_PC_MICROSOFT    0
  403. #define IBM_PC_TURBO        0
  404. #define KCC_20            0
  405. #define MSDOS            0
  406. #define PCC_20            0
  407. #define STDC            0
  408. #define UNIXPC            0
  409. #define UNIX_ATT        0
  410. #define UNIX_BSD        0
  411. #define _AIX            0
  412. #define _AIX370            0
  413. #define _IBMR2            0
  414. #define _HPUX_SOURCE        0
  415. #define _POSIX_SOURCE        0
  416. #define __ACC__            0
  417. #define __CC__            0
  418. #define __COMPILER_KCC__    0
  419. #define __GNUC__        0
  420. #define __GNUG__        0
  421. #define __LCC__            0
  422. #define __NeXT__        0
  423. #define __STDC__        0
  424. #define __SUNCC__        0
  425. #define __TURBOC__        0
  426. #define __convex__        0
  427. #define __cplusplus        0
  428. #define __hppa            0
  429. #define __hpux            0
  430. #define __sgi            0
  431. #define __sgi__            0
  432. #define __unix            0
  433. #define ardent            0
  434. #define c_plusplus        0
  435. #define hp300            0
  436. #define hpux            0
  437. #define mips            0
  438. #define ps2            0
  439. #define sgi            0
  440. #define sun            0
  441. #define sun386            0
  442. #define ultrix            0
  443. #define unix            0
  444. #define unixpc            0
  445. #define usg            0
  446.  
  447. #ifdef OS_VAXVMS
  448. #undef OS_VAXVMS
  449. #endif /* OS_VAXVMS */
  450.  
  451. #define OS_VAXVMS        1
  452. #define STDC            1
  453. #endif /* VMS */
  454.  
  455. #if    (unix || __unix)        /* (all?) UNIX systems define one of these */
  456.  
  457. #ifdef OS_UNIX
  458. #undef OS_UNIX
  459. #endif /* OS_UNIX */
  460.  
  461. #define OS_UNIX            1
  462.  
  463. #endif /* (unix || __unix) */
  464.  
  465. #if    _AIX
  466. /***********************************************************************
  467. Both AIX-370 with the MetaWare High C Compiler R2.1n, and IBM AIX PS/2
  468. C Language - Version 1.1, support Standard C-style function prototypes
  469. and declarations, and have Standard C include files.  The preprocessor
  470. symbols defined by these compilers are:
  471.  
  472. PS/2:        _AIX    AIX        NLS    ps2
  473. 3090:        _AIX    AIX    _AIX370    NLS    __HIGHC__    __STDC__
  474. RS/6000:    _AIX    _IBMR2
  475. ***********************************************************************/
  476.  
  477. #ifdef OS_UNIX
  478. #undef OS_UNIX
  479. #endif /* OS_UNIX */
  480.  
  481. #if (_AIX370 || ps2)
  482. #define HAVE_MEMXXX_DCL        1
  483. #undef HAVE_FPOS_T        /* fpos_t is missing from <sys/types.h> */
  484. #undef HAVE_GETLOGIN_DCL
  485. #undef HAVE_GETPWNAM_DCL
  486. #undef HAVE_GETWD_DCL
  487. #if __cplusplus
  488. #define HAVE_FPOS_T        1
  489. #define HAVE_GETLOGIN_DCL    1
  490. #define HAVE_GETLOGIN        1
  491. #define HAVE_GETPWNAM_DCL    1
  492. #define HAVE_GETPWNAM        1
  493. #define HAVE_GETWD_DCL        1
  494. #undef HAVE_GETWD
  495. #define HAVE_GETWD        1
  496. #endif /* __cplusplus */
  497. #endif /*  (_AIX370 || ps2) */
  498.  
  499. #define OS_UNIX            1
  500. #define STDC            1
  501. #endif /* _AIX */
  502.  
  503. /* NB: We check for AIX separately from _AIX.  Both are defined by
  504. Standard C-level compilers on AIX, but _AIX is not defined by
  505. pre-Standard C compilers */
  506.  
  507. #if    AIX    /* IBM PS/2 and RT AIX (System V.2 UNIX + BSD extensions) */
  508. #undef UNIX_ATT
  509. #define UNIX_ATT        1
  510. #endif /* AIX */
  511.  
  512. #if    MSDOS  /* Microsoft C 3, 4, 5, Quick C 1, 2 (latter defines _QC too) */
  513.  
  514. #ifdef OS_PCDOS
  515. #undef OS_PCDOS
  516. #endif /* OS_PCDOS */
  517.  
  518. #define OS_PCDOS        1
  519.  
  520. #ifdef IBM_PC_MICROSOFT
  521. #undef IBM_PC_MICROSOFT
  522. #endif /* IBM_PC_MICROSOFT */
  523.  
  524. #define IBM_PC_MICROSOFT    1
  525. #define STDC            1
  526. #endif /* MSDOS */
  527.  
  528. #if    __TURBOC__ /* Turbo C 2.0 (it also defines __MSDOS__) */
  529.         /* __STDC__ is predefined only if -A compile switch used */
  530.  
  531. #undef HAVE_TZNAME_DCL            /* missing from time.h */
  532. #define HAVE_TZNAME             1
  533.  
  534. #ifdef OS_PCDOS
  535. #undef OS_PCDOS
  536. #endif /* OS_PCDOS */
  537.  
  538. #define OS_PCDOS        1
  539.  
  540. #ifdef IBM_PC_TURBO
  541. #undef IBM_PC_TURBO
  542. #endif /* IBM_PC_TURBO */
  543.  
  544. #define IBM_PC_TURBO        1
  545. #define STDC            1
  546.  
  547. #if (__TURBOC__ >= 0x0400)
  548. /* tcc 3.0 does not define stdaux or stdprn in the __STDC__ environment,
  549. but we need them, and fileno() too */
  550. #define fileno(f)       ((f)->fd)
  551. #if __cplusplus
  552. #define stdaux        __getStream(3)
  553. #define stdprn        __getStream(4)
  554. #else /* NOT __cplusplus */
  555. #define stdaux        (&_streams[3])
  556. #define stdprn        (&_streams[4])
  557. #endif /* __cplusplus */
  558.  
  559. #endif /* (__TURBOC__ >= 0x400) */
  560. #endif /* __TURBOC__ */
  561.  
  562. #if    __COMPILER_KCC__
  563.  
  564. #ifdef OS_TOPS20
  565. #undef OS_TOPS20
  566. #endif /* OS_TOPS20 */
  567.  
  568. #define OS_TOPS20        1
  569.  
  570. #ifdef KCC_20
  571. #undef KCC_20
  572. #endif /* KCC_20 */
  573.  
  574. #define KCC_20            1
  575.  
  576. #ifdef __STDC__
  577. #define STDC            1    /* KCC 6 or later */
  578. #endif /* __STDC__ */
  579.  
  580. #endif /* __COMPILER_KCC__ */
  581.  
  582. #if    KCC_20
  583.  
  584. #ifdef OS_TOPS20
  585. #undef OS_TOPS20
  586. #endif /* OS_TOPS20 */
  587.  
  588. #define OS_TOPS20        1
  589. #endif /* KCC_20 */
  590.  
  591. #if    PCC_20
  592.  
  593. #ifdef OS_TOPS20
  594. #undef OS_TOPS20
  595. #endif /* OS_TOPS20 */
  596.  
  597. #define OS_TOPS20        1
  598. #endif /* PCC_20 */
  599.  
  600. #if    OS_TOPS20
  601. #if    (KCC_20 || PCC_20)
  602. #else  /* NOT (KCC_20 || PCC_20) */
  603.  
  604. #ifdef KCC_20
  605. #undef KCC_20
  606. #endif /* KCC_20 */
  607.  
  608. #define KCC_20            1    /* KCC-20 is default for Tops-20 */
  609. #endif /* (KCC_20 || PCC_20) */
  610. #endif /* OS_TOPS20 */
  611.  
  612. #if    __ACC__            /* Sun 4 SunOS 4.1.1 semi-Standard C compiler */
  613. #define sun            1    /* doesn't define, but we need it */
  614. #define STDC            1
  615. #define HAVE_STDDEF_H        1
  616. #define HAVE_STDLIB_H        1
  617. #endif /* __ACC__ */
  618.  
  619. #if    ardent                /* Ardent Titan (Stardent 1520) UNIX */
  620. #undef HAVE_CLOCK_T            /* (System V + BSD extensions) */
  621. #undef HAVE_FPOS_T
  622. #undef HAVE_GETCWD_DCL
  623. #undef HAVE_GETLOGIN_DCL
  624. #undef HAVE_GETWD
  625. #undef HAVE_GETWD_DCL
  626. #undef HAVE_PROTOTYPES
  627. #undef HAVE_VOIDP
  628.  
  629. #define HAVE_CONST_TYPE        0    /* has const, but include files  */
  630.                     /* don't use it, so we must not */
  631.                     /* either to avoid declaration  */
  632.                     /* conflicts */
  633. #define HAVE_GETCWD        1
  634. #define HAVE_GETCWD_DCL        0    /* missing from include files */
  635. #define HAVE_GETLOGIN        1
  636. #define HAVE_GETLOGIN_DCL    0    /* missing from include files */
  637. #define HAVE_MEMXXX_DCL        1
  638. #define HAVE_PROTOTYPES        1
  639. #define HAVE_SIZE_T        1
  640. #define HAVE_TIME_T        1
  641. #define HAVE_TZNAME        1
  642. #define HAVE_VOIDP        1
  643.  
  644. #undef UNIX_ATT
  645. #define UNIX_ATT        1
  646. #endif /* ardent */
  647.  
  648. #if BSD                    /* this works for BSD 4.3 on HP 370 */
  649. #undef HAVE_FPOS_T
  650. #undef HAVE_GETWD
  651. #undef HAVE_GETWD_DCL
  652. #undef UNIX_BSD
  653. #define HAVE_GETWD        1
  654. #define HAVE_GETWD_DCL        1
  655. #define UNIX_BSD        1
  656. #endif
  657.  
  658. #if __convex__
  659. #define STDC            1
  660. #endif /* __convex__ */
  661.  
  662. #if (__GNUC__ || __cplusplus)
  663. #undef HAVE_CONST_TYPE
  664. #undef HAVE_PROTOTYPES
  665. #undef HAVE_VOIDP
  666. #undef HAVE_VOLATILE_TYPE
  667.  
  668. #define HAVE_CONST_TYPE        1
  669. #define HAVE_PROTOTYPES        1
  670. #define HAVE_VOIDP        1
  671. #define HAVE_VOLATILE_TYPE    1
  672. #define STDC            1
  673. #endif /* (__GNUC__ || __cplusplus) */
  674.  
  675. #if    __hppa && _POSIX_SOURCE
  676. #define STDC            1
  677. #define HAVE_STDDEF_H        1
  678. #define HAVE_STDLIB_H        1
  679. #endif /* __hppa && _POSIX_SOURCE */
  680.  
  681. #if    __hppa && _HPUX_SOURCE
  682. #define STDC            1
  683. #define HAVE_STDDEF_H        1
  684. #define HAVE_STDLIB_H        1
  685. #undef HAVE_GETHOSTNAME
  686. #define HAVE_GETHOSTNAME    1
  687. #undef HAVE_GETHOSTNAME_DCL
  688. #define HAVE_GETHOSTNAME_DCL    1
  689. #endif /* __hppa && _HPUX_SOURCE */
  690.  
  691. #if    (hpux || __hpux)    /* Hewlett-Packard UNIX (System V + BSD extensions) */
  692. #undef HAVE_GETWD
  693. #undef HAVE_TZNAME
  694. #undef UNIX_ATT
  695.  
  696. #define HAVE_TZNAME             1
  697.  
  698. #ifdef __STDC__
  699. #define STDC            1
  700. #endif /* __STDC__ */
  701.  
  702. #define UNIX_ATT        1
  703. #endif /* (hpux || __hpux) */
  704.  
  705. #if    __LCC__        /* AT&T / Princeton retargetable Standard C compiler: */
  706.             /* lcc has code generators for several architectures, */
  707.             /* and its own Standard C include files. */
  708. #define STDC            1
  709. #define HAVE_STDDEF_H        1
  710. #define HAVE_STDLIB_H        1
  711. #endif /* __LCC__ */
  712.  
  713. #if mips && !(ardent || __sgi || ultrix)/* MIPS UNIX (System V.3 and BSD 4.3) */
  714.  
  715. #undef HAVE_FPOS_T        /* fpos_t is missing from <sys/types.h> */
  716. #undef HAVE_CLOCK_T
  717. #undef HAVE_GETLOGIN_DCL
  718. #undef HAVE_GETPWNAM_DCL
  719. #undef HAVE_GETUID_DCL
  720.  
  721. #define HAVE_MEMXXX_DCL        1
  722. #define HAVE_TM_ZONE        1    /* time.h struct tm has tm_zone */
  723.                     /* in -systype bsd43 environment */
  724. #undef UNIX_BSD
  725. #define UNIX_BSD        1
  726. #endif /* mips && !(ardent || __sgi || ultrix) */
  727.  
  728. #if    __NeXT__
  729. /* NeXT systems use the GNU C compiler and MACH (4.3BSD system call
  730. compatible).  The compiler predefines __MACH__, mc68000, NeXT,
  731. __STDC__, and unix, and has Standard C-conformant library and header
  732. files. */
  733. #define STDC            1
  734. #undef UNIX_BSD
  735. #define UNIX_BSD        1
  736. #undef HAVE_GETUID_DCL
  737. #undef HAVE_GETWD
  738. #undef HAVE_GETWD_DCL
  739. #define HAVE_GETWD        1
  740. #define HAVE_GETWD_DCL        1
  741. #undef HAVE_GETCWD
  742. #undef HAVE_GETCWD_DCL
  743. #endif /* __NeXT__ */
  744.  
  745. #if    (sgi || __sgi)            /* Silicon Graphics UNIX System V.x */
  746.  
  747. #undef UNIX_ATT
  748. #define UNIX_ATT        1
  749. #endif /* (sgi || __sgi) */
  750.  
  751. #if __sgi__ && __GNUC__
  752. /* GNU C 1.39 is missing these symbols that cc defines, and we need them */
  753. #define __SVR3            1
  754. #define __host_mips        1
  755. #define __mips            1
  756. #define __sgi            1
  757. #define __unix            1
  758. #endif /* __sgi__ && __GNUC__ */
  759.  
  760. #if    __sgi            /* Silicon Graphics Iris Indigo IRIX 4.0.1*/
  761. #define STDC            1
  762. #define HAVE_MEMXXX_DCL        1
  763. #define HAVE_SSCANF_FUNCTION    1
  764. #define HAVE_OPEN_DCL        1
  765. #define HAVE_STDDEF_H        1
  766. #define HAVE_STDLIB_H        1
  767. #endif /* __sgi */
  768.  
  769. #if    __SUNCC__
  770. #define sun    1
  771. #endif /* __SUNCC__ */
  772.  
  773. #if    sun    /* Sun Microsystems UNIX OS 3.x and 4.x (4.2BSD) */
  774. #undef HAVE_FPOS_T        /* fpos_t is missing from <sys/types.h> */
  775. #undef HAVE_GETCWD_DCL
  776. #undef HAVE_GETLOGIN_DCL
  777. #undef HAVE_GETUID_DCL
  778.  
  779. #if    __ACC__
  780. #define HAVE_MEMXXX_DCL        1
  781. #endif /* __ACC__ */
  782.  
  783. #define HAVE_GETLOGIN_DCL    1
  784. #define HAVE_GETUID_DCL        1
  785.  
  786. #if    __GNUC__
  787. #undef HAVE_GETLOGIN_DCL
  788. #undef HAVE_GETUID_DCL
  789. #endif /* __GNUC__ */
  790.  
  791. #if    __SUNCC__
  792. #undef HAVE_GETWD
  793. #undef HAVE_GETWD_DCL
  794. #define HAVE_GETWD    1
  795. #define HAVE_GETWD_DCL    1
  796. #endif /* __SUNCC__ */
  797.  
  798. #if    sun386                /* Sun 386i */
  799. #undef HAVE_CLOCK_T
  800. #undef HAVE_GETLOGIN_DCL
  801.  
  802. #define HAVE_SSCANF_FUNCTION    1    /* true for all versions */
  803. #else                    /* Sun 3 or 4 */
  804. #define HAVE_SSCANF_FUNCTION    1    /* true for all versions */
  805. #define HAVE_OPEN_DCL        1    /* true at SunOS 4.0 or later */
  806.                     /* defined in sys/fcntlcom.h */
  807. #define HAVE_STDDEF_H        1    /* true at SunOS 4.1 or later, even */
  808.                     /* though cc is not yet Standard C */
  809. #define HAVE_STDLIB_H        1    /* true at SunOS 4.1 or later, even */
  810.                     /* though cc is not yet Standard C */
  811. #endif /* sun386 */
  812.  
  813. #if __cplusplus
  814. #undef HAVE_OPEN_DCL
  815. #endif /* __cplusplus */
  816.  
  817. #define HAVE_TM_ZONE        1    /* time.h struct tm has tm_zone */
  818.  
  819. #undef UNIX_BSD
  820. #define UNIX_BSD        1
  821. #endif /* sun */
  822.  
  823. #if    ultrix    /* DEC version of 4.2BSD UNIX */
  824. #define HAVE_MEMXXX_DCL        1
  825. #define HAVE_OPEN_DCL        1
  826. #define HAVE_TM_ZONE        1    /* time.h struct tm has tm_zone */
  827. #undef HAVE_GETUID_DCL
  828.  
  829. #if   __GNUG__
  830. #define HAVE_GETUID_DCL        1
  831. #endif
  832.  
  833. #if    __LCC__
  834. #undef HAVE_TM_ZONE
  835. #define HAVE_STRFTIME        1
  836. #define HAVE_STRFTIME_DCL    1
  837. #endif /* __LCC__ */
  838.  
  839. #undef UNIX_BSD
  840. #define UNIX_BSD        1
  841. #endif /* ultrix */
  842.  
  843. #if    unixpc    /* UNIX PC (System V) */
  844. #undef UNIX_ATT
  845. #define UNIX_ATT        1
  846. #endif /* unixpc */
  847.  
  848. #if    usg    /* AT&T UNIXes may be define this (GNU EMACS uses USG) */
  849. #undef UNIX_ATT
  850. #define UNIX_ATT        1
  851. #endif /* usg */
  852.  
  853. #if   (OS_ATARI || OS_PCDOS || OS_PRIMOS || OS_RMX || OS_TOPS20)
  854. #else /* NOT (OS_ATARI || OS_PCDOS || OS_PRIMOS || OS_RMX || OS_TOPS20) */
  855. #if   (OS_UNIX || OS_VAXVMS || OS_VMCMS)
  856. #else /* NOT (OS_UNIX || OS_VAXVMS || OS_VMCMS) */
  857.             /* OS_UNIX is default if no operating system defined */
  858. #undef OS_UNIX
  859. #define OS_UNIX            1
  860. #endif /* (OS_UNIX || OS_VAXVMS || OS_VMCMS) */
  861. #endif /* (OS_ATARI || OS_PCDOS || OS_PRIMOS || OS_RMX || OS_TOPS20) */
  862.  
  863. #ifndef STDC
  864. #define STDC            0
  865. #endif /* STDC */
  866.  
  867. /***********************************************************************
  868. Here are O/S- and compiler-specific sections to redefine HAVE_xxx
  869. flags that must be changed.
  870. ***********************************************************************/
  871.  
  872. #if    STDC
  873. #undef HAVE_CONST_TYPE
  874. #undef HAVE_PROTOTYPES
  875. #undef HAVE_VOIDP
  876. #undef HAVE_VOLATILE_TYPE
  877.  
  878. #define HAVE_CONST_TYPE        1
  879.  
  880. #if sun
  881. #define HAVE_FPOS_T        __ACC__
  882.             /* acc has it, but cc, gcc, and g++ stdio.h lack it */
  883. #endif /* sun */
  884.  
  885. #define HAVE_PROTOTYPES        1
  886. #define HAVE_SIZE_T        1
  887. #define HAVE_TIME_T        1
  888. #define HAVE_VOIDP        1
  889. #define HAVE_VOLATILE_TYPE    1
  890. #endif /* STDC */
  891.  
  892. #if    OS_ATARI
  893. #undef HAVE_SYS_DIR
  894. #endif /* OS_ATARI */
  895.  
  896. #if    OS_PCDOS
  897. #undef HAVE_GETWD_DCL
  898. #undef HAVE_FILE_H
  899. #undef HAVE_PARAM_H
  900. #define HAVE_MEMXXX_DCL        1
  901. #endif /* OS_PCDOS */
  902.  
  903. #if    OS_PRIMOS
  904. #undef HAVE_ERRNO_H
  905. #endif /* OS_PRIMOS */
  906.  
  907. #if    OS_RMX
  908. #endif /* OS_RMX */
  909.  
  910. #if    OS_TOPS20
  911. #if    KCC_20 && !STDC
  912. #undef HAVE_SYS_DIR
  913. #endif /* KCC_20 && !STDC */
  914. #endif /* OS_TOPS20 */
  915.  
  916. #if    OS_UNIX
  917. #undef HAVE_PWD_H
  918. #define HAVE_PWD_H        1
  919.  
  920. #if    !(UNIX_ATT || UNIX_BSD)
  921. #undef UNIX_BSD
  922. #define UNIX_BSD        1    /* UNIX_BSD is default UNIX variant */
  923. #endif /* !(UNIX_ATT || UNIX_BSD) */
  924. #endif /* OS_UNIX */
  925.  
  926. #if    OS_VAXVMS
  927. #undef HAVE_SYS_DIR
  928. #define HAVE_SYS_DIR        0
  929. #endif /* OS_VAXVMS */
  930.  
  931. #if    OS_VMCMS
  932. #undef HAVE_SYS_DIR
  933. #undef HAVE_ERRNO_H
  934. #endif /* OS_VMCMS */
  935.  
  936. /* A few implementations know about const, even though they are not
  937. yet Standard C.  For the rest, make the type an empty string. */
  938.  
  939. #if !HAVE_CONST_TYPE
  940. #define const
  941. #endif /* !HAVE_CONST_TYPE */
  942.  
  943. #if !HAVE_CLOCK_T
  944. typedef    long clock_t;
  945. #endif /* !HAVE_CLOCK_T */
  946.  
  947. #if !HAVE_FPOS_T
  948. typedef long fpos_t;
  949. #endif /* !HAVE_FPOS_T */
  950.  
  951. #if HAVE_PROTOTYPES
  952. #define ARGS(parenthesized_list) parenthesized_list
  953. #else /* NOT HAVE_PROTOTYPES */
  954. #define ARGS(parenthesized_list) ()
  955. #endif /* HAVE_PROTOTYPES */
  956.  
  957. #if !HAVE_SIZE_T
  958. typedef unsigned int size_t;
  959. #endif /* !HAVE_SIZE_T */
  960.  
  961. #if !HAVE_TIME_T
  962. typedef long time_t;
  963. #endif /* !HAVE_TIME_T */
  964.  
  965. #if HAVE_VOIDP
  966. #define VOIDP            void*
  967. #else  /* NOT HAVE_VOIDP */
  968. #define VOIDP            char*
  969. #endif /* HAVE_VOIDP */
  970.  
  971. #if !HAVE_VOLATILE_TYPE
  972. #define volatile
  973. #endif /* !HAVE_VOLATILE_TYPE */
  974.  
  975. /***********************************************************************
  976. The system limit on the number of open files usually is set in a system
  977. include file, but regrettably has no standard name.  The following have
  978. been observed:
  979.  
  980. --------    -------------    ------------------------------------------
  981. Name        Definition    System
  982. --------    -------------    ------------------------------------------
  983. IOFILES        <stdio.h>    Wizard C
  984. NFILE        <stdio.h>    V7 UNIX
  985. NOFILE        <sys/param.h>    Sun OS (4.2BSD), 4.3BSD and Gould UTX/32
  986. OPEN_MAX    <limits.h>    POSIX
  987. OPEN_MAX    <stdio.h>    Turbo C 2.0
  988. SYS_OPEN    <stdio.h>    KCC-20, Turbo C 2.0, Microsoft C 5.0,
  989.                 Wizard C
  990. _NFILE        <stdio.h>    VAX VMS, NMTCC-20, PCC-20, SYS V, HPUX,
  991.                 Microsoft C 5.0, Lattice C, Primos,
  992.                 IBM AIX (370, PS/2, RT)
  993. _NFILE        <sys/param.h>    KCC-20
  994. FOPEN_MAX    <stdio.h>    Intel RMX, IBM AIX (RS)
  995. --------    -------------    ------------------------------------------
  996.  
  997. We use a private symbol OPENMAX;  it is needed for cached-font support
  998. in gblvars.h.
  999. ***********************************************************************/
  1000.  
  1001. /* Include stdio.h, and if available, param.h, and maybe, limits.h */
  1002.  
  1003. #include <stdio.h>
  1004.  
  1005. #if HAVE_PARAM_H
  1006. #if HAVE_SYS_DIR
  1007. #include <sys/param.h>
  1008. #else /* HAVE_SYS_DIR */
  1009. #include <param.h>
  1010. #endif /* HAVE_SYS_DIR */
  1011. #endif /* HAVE_PARAM_H */
  1012.  
  1013. #ifndef OPENMAX
  1014. #ifdef FOPEN_MAX
  1015. #define OPENMAX            FOPEN_MAX
  1016. #endif /* FOPEN_MAX */
  1017. #endif /* OPENMAX */
  1018.  
  1019. #ifndef OPENMAX
  1020. #ifdef NFILE
  1021. #define OPENMAX            NFILE
  1022. #endif /* NFILE */
  1023. #endif /* OPENMAX */
  1024.  
  1025. #ifndef OPENMAX
  1026. #ifdef _NFILE
  1027. #define OPENMAX            _NFILE
  1028. #endif /* _NFILE */
  1029. #endif /* OPENMAX */
  1030.  
  1031. #ifndef OPENMAX
  1032. #ifdef NOFILE
  1033. #define OPENMAX            NOFILE
  1034. #endif /* NOFILE */
  1035. #endif /* OPENMAX */
  1036.  
  1037. #ifndef OPENMAX
  1038. #ifdef SYS_OPEN
  1039. #define OPENMAX            SYS_OPEN
  1040. #endif /* SYS_OPEN */
  1041. #endif /* OPENMAX */
  1042.  
  1043. #ifndef OPENMAX
  1044. #include <limits.h>
  1045. #ifdef OPEN_MAX
  1046. #define OPENMAX            OPEN_MAX
  1047. #endif /* OPEN_MAX */
  1048. #endif /* OPENMAX */
  1049.  
  1050. #ifndef OPENMAX
  1051. /* Cause a compilation error */
  1052. ??? cannot find needed definition of OPENMAX ???
  1053. #endif /* OPENMAX */
  1054.  
  1055. /***********************************************************************
  1056. The limit on file name lengths is similarly non-standard.
  1057.  
  1058. --------    -------------    ------------------------------------------
  1059. Name        Definition    System
  1060. --------    -------------    ------------------------------------------
  1061. FNMAX        <stdio.h>    PCC-20
  1062. MAXPATH        <dir.h>        Turbo C 2.0, C and C++ 3.0, and TopSpeed C
  1063. _MAX_PATH    <stdlib.h>    Microsoft C 5.0, 6.0, 7.0 and TopSpeed C
  1064. MAXPATHLEN    <sys/param.h>    Sun OS (4.2BSD), 4.3BSD, Gould UTX/32,
  1065.                 HPUX, KCC-20, AIX (RT, RS, PS/2, 370),
  1066.                 HP/Apollo DomainOS
  1067. PATH_MAX    <stdio.h>    SYS V (Silicon Graphics)
  1068. PATH_MAX    <limits.h>    POSIX
  1069. FILENAME_MAX    <stdio.h>    Intel RMX, NeXT Mach, Turbo C/C++ 3.0
  1070. --------    -------------    ------------------------------------------
  1071.  
  1072. We already have included <sys/param.h>, <limits.h>, and <stdio.h>.  If
  1073. we cannot find preset values, we set values based on experience; this
  1074. parameter is less critical than OPENMAX.  MAXPATHLEN should also be
  1075. long enough to hold a file search path from an environment variable;
  1076. on systems with small MAXPATHLEN values, this may be a problem.
  1077. ***********************************************************************/
  1078.  
  1079. #ifndef MAXPATHLEN
  1080. #ifdef PATH_MAX
  1081. #define MAXPATHLEN        PATH_MAX
  1082. #endif /* PATH_MAX */
  1083.  
  1084. #ifdef FNMAX
  1085.  
  1086. #ifdef MAXPATHLEN
  1087. #undef MAXPATHLEN
  1088. #endif /* MAXPATHLEN */
  1089.  
  1090. #define MAXPATHLEN        FNMAX
  1091. #endif /* FNMAX */
  1092.  
  1093. #ifdef FILENAME_MAX
  1094.  
  1095. #ifdef MAXPATHLEN
  1096. #undef MAXPATHLEN
  1097. #endif /* MAXPATHLEN */
  1098.  
  1099. #define MAXPATHLEN        FILENAME_MAX
  1100. #endif /* FILENAME_MAX */
  1101.  
  1102. #endif /* MAXPATHLEN */
  1103.  
  1104. #if OS_VAXVMS
  1105. #undef MAXPATHLEN        /* value of 39 is too small--reset below */
  1106. #endif /* OS_VAXVMS */
  1107.  
  1108. #ifndef MAXPATHLEN
  1109.  
  1110. #if    OS_ATARI
  1111. #define MAXPATHLEN        128
  1112. #endif /* OS_ATARI */
  1113.  
  1114. #if    OS_PCDOS
  1115. #define MAXPATHLEN        260    /* used to be 80, but recent DOS */
  1116.                     /* C compilers have 260 */
  1117. #endif /* OS_PCDOS */
  1118.  
  1119. #if    OS_PRIMOS
  1120. #define MAXPATHLEN        128 /* not in system .h files */
  1121. #endif /* OS_PRIMOS */
  1122.  
  1123. #if    OS_RMX
  1124. #define MAXPATHLEN        64
  1125. #endif /* OS_RMX */
  1126.  
  1127. #if    OS_TOPS20
  1128. #define MAXPATHLEN        288
  1129. #endif /* OS_TOPS20 */
  1130.  
  1131. #if    OS_UNIX
  1132. #define MAXPATHLEN        1024    /* from <sys/param.h> in 4.3BSD */
  1133. #endif /* OS_UNIX */
  1134.  
  1135. #if    OS_VAXVMS
  1136. #define MAXPATHLEN        512    /* value uncertain */
  1137. #endif /* OS_VAXVMS */
  1138.  
  1139. #if    OS_VMCMS
  1140. #define MAXPATHLEN        128    /* value uncertain */
  1141. #endif /* OS_VMCMS */
  1142.  
  1143. #endif /* MAXPATHLEN */
  1144.  
  1145. /***********************************************************************
  1146. fopen() mode flags differ between systems.  Here are symbolic values:
  1147.     R_OPEN        -- text read
  1148.     RB_OPEN        -- binary read
  1149.     RW_OPEN        -- text read/write
  1150.     W_OPEN        -- text write
  1151.     WB_OPEN        -- binary write
  1152. ***********************************************************************/
  1153.  
  1154. #define R_OPEN            "r"
  1155. #define RB_OPEN            "r"
  1156. #define RW_OPEN            "w+"
  1157. #define W_OPEN            "w"
  1158. #define WB_OPEN            "w"
  1159.  
  1160. #if    OS_PCDOS
  1161. #undef RB_OPEN
  1162. #define RB_OPEN            "rb"
  1163.  
  1164. #undef WB_OPEN
  1165. #define WB_OPEN            "wb"
  1166. #endif /* OS_PCDOS */
  1167.  
  1168. #if    OS_PRIMOS
  1169. #undef HAVE_TYPES_H
  1170. #undef RB_OPEN
  1171. #define RB_OPEN            "i"
  1172.  
  1173. #undef RW_OPEN
  1174. #define RW_OPEN            "w"
  1175.  
  1176. #undef WB_OPEN
  1177. #define WB_OPEN            "o"
  1178. #endif /* OS_PRIMOS */
  1179.  
  1180. #if    OS_TOPS20
  1181. #undef RB_OPEN
  1182. #define RB_OPEN            "rb"
  1183.  
  1184. #undef WB_OPEN
  1185. #define WB_OPEN            "wb"
  1186. #endif /* OS_TOPS20 */
  1187.  
  1188. #if    OS_VAXVMS
  1189. #undef RB_OPEN
  1190. #define RB_OPEN            "rb"
  1191.  
  1192. #undef WB_OPEN
  1193. #define WB_OPEN            "wb"
  1194. #endif /* OS_VAXVMS */
  1195.  
  1196. #include "xstddef.h"
  1197. #include "xerrno.h"
  1198.  
  1199. /***********************************************************************
  1200. On [02-Nov-1991], driver development on UNIX was placed under the
  1201. Revision Control System (RCS).  For now, RCSID() will always generate
  1202. a static RCS version string.  We may later wish to suppress this to
  1203. conserve memory on small systems.  Thus, the expansion includes a
  1204. semicolon so that it can be made to completely disappear if we wish.
  1205. A typical initial usage is RCSID("<dollar>Id<dollar>"), where <dollar>
  1206. is a literal dollar sign.
  1207. ***********************************************************************/
  1208.  
  1209. #if OS_UNIX
  1210. #define RCSID(s) static char rcsid[] = s;
  1211. #else /* NOT OS_UNIX */
  1212. #define RCSID(s)
  1213. #endif /* OS_UNIX */
  1214.  
  1215. #if STDC
  1216. #define VOID_ARG    void
  1217. #else
  1218. #define VOID_ARG
  1219. #endif /* STDC */
  1220.  
  1221. #endif /* OS_H_DEFINED_ */
  1222.